package com.eight.service.impl;

import com.eight.dao.CoursewareDao;
import com.eight.entity.Courseware;
import com.eight.service.CoursewareServiceDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author :dyx
 * @Date:2022/4/26
 * @description:课件service
 */
@Service
public class CoursewareServiceImpl implements CoursewareServiceDao {
//    该注释让jvm运行时不检查，编译时检查  dao对象
    @Autowired(required = false)
    CoursewareDao dao;
    @Override
    public List<Courseware> findAll() {
//      执行dao层的selectAll方法，用集合接收
        List<Courseware> coursewares = dao.selectAll();
        return coursewares;
    }

    @Override
    public int insert(Courseware courseware) {
        return dao.insert(courseware);
    }
}
